

package cc.eddic.examinationsystem.dto;

import cc.eddic.examinationsystem.domain.Question;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.val;
import org.springframework.beans.BeanUtils;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class QuestionResponse {
    private String description;
    private Long id;
    public Question as(){
        return new Question(this.description);
    }
    public static QuestionResponse from(final Question question){
        val dto=new QuestionResponse();
        BeanUtils.copyProperties(question,dto);
        return dto;
    }
}


